package com.zyj.guava.stopwatch;

import java.util.concurrent.TimeUnit;

public class MethodTimeConsuming {

    public static void main(String[] args) throws InterruptedException {
        var startTime = System.currentTimeMillis();
        consumeTime();
        var endTime = System.currentTimeMillis();
        System.out.println("consume time = " + (endTime - startTime));
    }

    public static void consumeTime() throws InterruptedException {
        TimeUnit.SECONDS.sleep(2);
    }

}